package cn.edu.zxj.product.service.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created with IntelliJ IDEA.
 * Description：
 *
 * @author: zxj
 * @date: 2024-09-30
 * @time: 17:15:17
 */
@RequestMapping("/nacos")
@RefreshScope // 支持 Nacos 的动态刷新功能, 配置进⾏热更新
@RestController
public class NacosController {
    @Value("${nacos.test.num:0}") // :0表示默认值为0
    private Integer num;


    @RequestMapping("/getNum")
    public Integer getNum() {
        System.out.println("num: " + num);
        return num;
    }
}
